﻿using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using ZilLion.Core.DatabaseWrapper.Dapper;
using ZilLion.Core.Unities;

namespace ZilLion.Task.Domain.Respository
{
    public class TaskRunnerContext : IDbContext
    {
        private readonly string _connectionString;


        public TaskRunnerContext()
        {
            _connectionString = ConfigurationManager.AppSettings["NodeConfigDbConString"];
        }

        public IDbConnection GetConnection()
        {
            DbConnection connection = new SqlConnection(_connectionString);
            return connection;
        }

        public string ContextName => "TaskRunnerContext";
    }
}